bool isSameAfterReversals(int num) 
{
	int n = num;
	int m = 0;
	while (n) {
		m = m * 10 + n % 10;
		n /= 10;
	}
	while (m) {
		n = n * 10 + m % 10;
		m /= 10;
	}
	return n == num;
}